package com.atguigu.serviceedu.controller.site;

import com.atguigu.serviceedu.entity.CmsAdEntity;
import com.atguigu.serviceedu.service.CmsAdService;
import com.atguigu.vo.ResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/site/ad")
public class SiteAdController {
    @Autowired
    private CmsAdService cmsAdService;
    @GetMapping("/queryAdByTypeId/{id}")
    public ResultVO queryAdByTypeId(@PathVariable("id") String id){
        List<CmsAdEntity> cmsAdEntityList = cmsAdService.getAdByTypeId(id);
        return ResultVO.ok().Msg("获取同类型广告集合成功").Data("cmsAdEntityList",cmsAdEntityList);
    }
}

